import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Hello from "@/components/Hello";
import Students from "@/components/Students";
import Login from "@/components/Login";
import FinishStudents from "@/components/FinishStudents";
import WillStudents from "@/components/WillStudents";
import UpdateUserPass from "@/components/UpdateUserPass";
import classFeeRecord from "@/components/classFeeRecord";

Vue.use(VueRouter)

const routes = [
  {
    path: '/Hello',
    name: 'Hello',
    component: Hello,
    children: [
      {
        path: 'Students',//以“/”开头的嵌套路径会被当作根路径，所以子路由上不用加“/”;在生成路由时，主路由上的path会被自动添加到子路由之前，所以子路由上的path不用在重新声明主路由上的path了。
        name: 'Students',
        component: Students
      },
      {
        path: 'FinishStudents',
        name: 'FinishStudents',
        component: FinishStudents
      },
      {
        path: 'WillStudents',
        name: 'WillStudents',
        component: WillStudents
      },
      {
        path: 'UpdateUserPass',
        name: 'UpdateUserPass',
        component: UpdateUserPass
      },{
        path: 'classFeeRecord',
        name: 'classFeeRecord',
        component: classFeeRecord
      },
    ]
  },
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/Students',
    name: 'Students',
    component: Students
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
